<template>
  <div class="top-right-component">
    <div>
      <el-button
        type="warning"
        size="large"
        class="collection-button"
        @click="handleClick('collection')"
      >
        <span>我的收藏</span><br />
      </el-button>
    </div>
    <div>
      <el-button
        type="success"
        size="large"
        class="collection-button"
        @click="handleClick('application')"
      >
        <span>我的申请</span><br />
      </el-button>
    </div>
    <div>
      <el-button
        type="primary"
        size="large"
        class="collection-button"
        @click="handleClick('participation')"
      >
        <span>我的参与</span><br />
      </el-button>
    </div>
    <div>
      <el-button
        type="danger"
        size="large"
        class="collection-button"
        @click="handleClick('management')"
      >
        <span>我的管理</span><br />
      </el-button>
    </div>
  </div>
</template>

    <script>
export default {
  name: "TopRightComponent",
  props: {
    personalInfo: {
      type: Object,
      required: true
    }
  },
  data() {
    return {

    };
  },
  methods: {
    handleClick(content) {
      //用于触发change-content事件
      this.$emit("change-content", content);
    },
  },
};
</script>

<style scoped>
.top-right-component {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-around;
  width: 95%;
  padding: 20px;
  height: 75%;
  background-color: #fff;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.collection-button {
  flex: 0 1 150px; /* 减小基础宽度 */
  margin: 5px; /* 按钮间距 */
  padding: 20px; /* 按钮内边距 */
  border-radius: 40px; /* 圆角边框 */
  color: #ffffff;
  font-size: 18px; /* 字体大小 */
  background-size: 200% 200%;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
  transition: box-shadow 0.3s, transform 0.3s;
  border: none;
}

/* 更新更鲜艳的黄色系渐变色 */
.top-right-component > div:nth-child(1) .collection-button {
  background-image: linear-gradient(45deg, #ff9f00, #ff6f00);
}
.top-right-component > div:nth-child(2) .collection-button {
  background-image: linear-gradient(45deg, #ffd600, #ffab00);
}
.top-right-component > div:nth-child(3) .collection-button {
  background-image: linear-gradient(45deg, #ffe500, #ffca2c);
}
.top-right-component > div:nth-child(4) .collection-button {
  background-image: linear-gradient(45deg, #ffc500, #ffae00);
}

.collection-button:hover,
.collection-button:focus {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.collection-button span {
  display: block;
  margin-top: 5px;
  font-weight: bold;
}

@media (max-width: 768px) {
  .collection-button {
    flex: 0 1 120px; /* 在较小视口下进一步减小基础宽度 */
    padding: 15px; /* 减小内边距 */
    font-size: 16px; /* 减小字体大小 */
  }
}
</style>
